home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue54 / Construc / Unit3.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2000-01-03  |  1.3 KB  |  59 lines

  1. unit Unit3;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   StdCtrls;
  6.  
  7. type
  8.   TForm3 = class(TForm)
  9.     Button1: TButton;
  10.     Memo1: TMemo;
  11.     Button2: TButton;
  12.     procedure Button1Click(Sender: TObject);
  13.     procedure Button2Click(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   Form3: TForm3;
  22.  
  23. implementation
  24. {$R *.DFM}
  25. uses
  26.   CORBA, OrbPas30, CorbaObj, BobNotes_I, BobNotes_C;
  27.  
  28. procedure TForm3.Button1Click(Sender: TObject);
  29. var
  30.   Factory: CorBobNotesFactory;
  31.   Client: ICorBobNotes;
  32.   Lines: WideString;
  33. begin
  34.   Factory := TCorBobNotesFactoryHelper.Bind('CorBobNotes');
  35.   Client := Factory.CreateInstance('CorBobNotes');
  36.   Client.GetLines('Bob','swart',Lines);
  37.   Memo1.Lines.Add(Lines);
  38.   Client := nil;
  39.   Factory := nil
  40. end;
  41.  
  42. procedure TForm3.Button2Click(Sender: TObject);
  43. var
  44.   Factory,Client: TAny;
  45.   Lines: WideString;
  46.   User,Pass: WideString;
  47. begin
  48.   Factory := Orb.Bind('IDL:BobNotes/CorBobNotesFactory:1.0');
  49.   Client := Factory.CreateInstance('CorBobNotes');
  50.   User := 'Bob';
  51.   Pass := 'swart';
  52.   Client.GetLines(User,Pass,Lines);
  53.   Memo1.Lines.Add(Lines);
  54.   Client := unassigned;
  55.   Factory := unassigned;
  56. end;
  57.  
  58. end.
  59.